package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: SetmealDishMapper
 * Package: com.sky.mapper
 *
 * @Author：朱晨旭
 * @Version：1.0
 */
@Mapper
public interface SetmealDishMapper {
    /*
    * 根据菜品id查询套餐id
    * */
//    @Select("select * from sky_take_out.setmeal_dish where dish_id in (#{dishIds})")
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);
    /**
     * 批量保存套餐和菜品的关联关系
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);


/*
* 删除套餐菜品关系表中的数据
* * @param setmeal_id
* */
    void deleteBySetmealId(List<Long> setmeal_id);

    /**
     * 根据套餐id查询对应的中间表的setmealdish中的分数等数据
     * @param setmealId
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);
}
